﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;

namespace WebApplication2.UserControls
{
    public partial class ColorPicker : System.Web.UI.UserControl
    {
        // Delegates and Events
        
        public delegate void OnColorChanged(Color color);

        public event OnColorChanged Handler;


        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnSelect_Click(object sender, EventArgs e)
        {
            // myPanel.BackColor = Color.FromName(DropDownList1.SelectedValue);
            if (Handler != null)
            {
                Color selectedColor = Color.FromName(DropDownList1.SelectedValue);
                Handler(selectedColor);
            }
        }
    }
}